package com.janko.springbootbase.designmode.prototypeClonePatten;

/**
 * @Author nyk
 * @Date 2021/4/30 8:50
 * @Version 1.0
 * @Desc 实现浅克隆
 */
public class StudentEasy implements  Cloneable{
    public StudentEasy() {
    }

    public StudentEasy(String id, String name,Subject subject) {
        this.id = id;
        this.name = name;
        this.subject=subject;
    }

    String id;
    String name;
    Subject subject;

    public Subject getSubject() {
        return subject;
    }

    public void setSubject(Subject subject) {
        this.subject = subject;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

    @Override
    public String toString() {
        return "StudentEasy{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", subject=" + subject +
                '}';
    }
}

